type TupleToObject<T extends readonly (string | number | symbol)[]> = {
  [P in T[number]]: P;
};

const tuple = ["tesla", "model 3", "model X", "model Y"] as const;

type R = TupleToObject<typeof tuple>;

const obj: R = {
  tesla: "tesla",
  "model 3": "model 3",
  "model X": "model X",
  "model Y": "model Y",
};

// 限制对象的 key 只能是 string | number | symbol
// 1. 返回一个对象
// 2. B遍历一个数组 T[number]
// 3. 遍历interface keyof
// 4. 遍历 联合类型 union in
